//
//  SGStory.h
//  iPing
//
//  Created by Thomas on 8/12/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface TCSGStory : NSManagedObject {
	int checkForUpdates;
}
@property (readwrite, copy) NSString *title;
@property (readwrite, copy) NSString *idNumber;
@property (readwrite, copy) NSString *host;
@property (readwrite, copy) NSString *author;
@property (readwrite, copy) NSString *HTMLCode;
@property (readwrite, copy) NSString *name;
@property (readwrite, copy) NSString *genre, *summary, *codes;
@property (readwrite, copy) NSNumber *lastDownloadedChapter;
@property (readwrite, copy) NSNumber *lastReadChapter;
//@property BOOL *checkForUpdates; 

+(TCSGStory *)storyFromDictionary:(NSDictionary *)infoDict withName:(NSString *)name 
			inManagedObjectContext:(NSManagedObjectContext *)context;



+(TCSGStory *) storyForHTMLCode:(NSString *)HTMLCode withContext:context;

+(TCSGStory *) setLastReadChapter:(int)chapterNumber forHTMLCode:(NSString *)HTMLCode inManagedObjectContext:(NSManagedObjectContext *)context;

+(TCSGStory *)storyNoInsertFromDictionary:(NSDictionary *)infoDict 
								 withName:(NSString *)name 
				   inManagedObjectContext:(NSManagedObjectContext *)context;


+(void)removeObjectForHTMLCode:(NSString *)HTMLCode inContext:(NSManagedObjectContext *)context;

+(int)getLastReadChapterNumberForHTMLCode:(NSString *)HTMLCode inContext:(NSManagedObjectContext *)context;


-(void) setLastReadChapters:(int)chapterNumber;

@end
